#ifndef __DEV_H__
#define __DEV_H__

#include <common.h>

//参考$am/src/platform/nemu/include/nemu.h
#define DEVICE_BASE 0xd0000000
#define MMIO_BASE   0xd0000000

#define SERIAL_PORT (DEVICE_BASE) + 0x000003f8
#define RTC_ADDR	(DEVICE_BASE) + 0x00000048
#define KBD_ADDR	(DEVICE_BASE) + 0x00000060
#define VGACTL_ADDR (DEVICE_BASE) + 0x00000100
#define FB_ADDR     (MMIO_BASE  ) + 0x01000000 //vga绘制区

uint64_t get_time();
void init_rand();

void i8042_init();
void send_key(uint8_t scancode, bool is_keydown);
uint32_t key_dequeue();

void vga_init();
void vga_update_screen();
uint32_t screen_size();
void vga_clear_screen();
void vga_set_sync(uint32_t data);
uint32_t vga_get_hw();

void device_init();
void device_update();
#endif 
